@textlint/ast-tester
Compliance tests for textlint's AST(Abstract Syntax Tree).
It check compliance of AST at minimum.
If you have created Processor plugin for textlint, you can use it for testing the plugin.
Installation
npm install -D @textlint/ast-tester
Usage
test(textlintAST): void
if the AST is invalid, then throw Error
isTxtAST(textlintAST): boolean
if the AST is valid, then return true
.
import {test, isTxtAST} from "@textlint/ast-tester";
import yourParse from "your-parser";
const AST = yourParse("This is text");
test(AST);
isTxtAST(AST);
Tests
npm test
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT